﻿namespace ProjectIndieFarm
{
    public class ChallengeGroupCarrot
    {
        public static void Setup(IChallengeSystem system)
        {
            var carrot1 = system.Add(new GenericChallenge()
                .SetChallengeName("收获 1个胡萝卜")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountCarrot > 0)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 100;
                    self.SendMessageWithReward(100);
                }));
            var carrot10 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第10个胡萝卜")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountCarrot >= 10)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 100;
                    self.SendMessageWithReward(100);
                }));
            var carrot20 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第20个胡萝卜")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountCarrot >= 20)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 100;
                    self.SendMessageWithReward(100);
                }));
            var carrot30 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第30个胡萝卜")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountCarrot >= 30)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 100;
                    self.SendMessageWithReward(100);
                }));
            var carrot50 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第50个胡萝卜")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountCarrot >= 50)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 100;
                    Global.ShowTomatoSeedInShop.Value = true;
                    self.SendMessageWithRewardAndOther(100,"商店新增<color=orange>西红柿种子</color>");
                }));
        }
    }
}
